#pragma once

#include "my_queue.h"

typedef void (*my_hook_handler_pt)(void *data);

typedef struct {
    my_hook_handler_pt              handler;
    my_queue_t                      queue;
} my_hook_item_t;


typedef struct {
    my_queue_t                      head;
} my_hook_chain_t;


my_hook_chain_t *my_hook_chain_create();

// free hook chain and hook_item inside it.
void my_hook_chain_destroy(my_hook_chain_t *hook_chain);

void my_hook_chain_register(my_hook_chain_t *hook_chain,
    my_hook_handler_pt hook_handler);

void my_hook_chain_exec(my_hook_chain_t *hook_chain, void *data);


